home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d1 / ansi10.arc / ANSI.TXT next >
Text File  |  1991-03-03  |  35KB  |  686 lines

  1.               THEE COMPLEAT ANSI COLOR/ANIMATION/MUSIC MANUAL
  2.                 FOR YOUR AMIGA or IBM-Compatible Computer
  3. [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]
  4.     Before we get to specific ways to send control codes to the ANSI/Amigados
  5. driver, you must first know what those codes mean.  For the function keys the
  6. codes are listed on the chart below.
  7. ==============================================================================
  8.        FUNCTION KEY REASSIGNMENT WITH ANSI (Does NOT work on AMIGA!)
  9. ------------------------------------------------------------------------------
  10.    Each function key is assigned an "extended function code" which DOS will use
  11. to recognize that a function key has been pressed and in what shifted mode, if
  12. any.  Each number is expressed as a 0 followed by a semi-colon, then the
  13. number from the chart below.
  14.  
  15.                 KEY     NORMAL  SHIFT   CONTROL  ALT
  16.                 F1      59      84      94      104
  17.                 F2      60      85      95      105
  18.                 F3      61      86      96      106
  19.                 F4      62      87      97      107
  20.                 F5      63      88      98      108
  21.                 F6      64      89      99      109
  22.                 F7      65      90      100     110
  23.                 F8      66      91      101     111
  24.                 F9      67      92      102     112
  25.                 F10     68      93      103     113
  26.  
  27. Accordingly, the way to designate the F5 key would be 0;63 while the F10 key
  28. would be designated by 0;68 or 0;113 if shifted with the ALT key.
  29. ============================================================================
  30.           KEYBOARD REASSIGNMENT WITH ANSI (Does not work on AMIGA!)
  31. ----------------------------------------------------------------------------
  32. If you examine the DOS Technical Reference Manual (not the Technical Manual
  33. for PC hardware), you will find a section on SCREEN/KEYS.  This section was
  34. contained in the DOS 2.0 documentation, but IBM removed it in later editions.
  35. Here is a summary of its contents relative to keyboard redefinition.
  36.  
  37. To change one key to have the meaning of another, enter:
  38.  
  39.                                  ESC [#;#p
  40.  
  41. where the first # is the ASCII value of the key being changed and the second #
  42. is the ASCII value of the new definition.  For example, "A" has the ASCII
  43. value of 65 and "Q" has the value of 81.  So:
  44.  
  45.                                  ESC [65;81p
  46.  
  47. will result in "A" being redefined as "Q."  It is also possible to redefine a
  48. key to have the meaning of a string of characters.  This is done by enclosing
  49. the string in quotes.  So:
  50.  
  51.                                  ESC [65;"Hi there"p
  52.  
  53. would change the "A" key to have the meaning of "Hi there."  If the first
  54. value for the first # is a 0 however, DOS knows that what is being changed is
  55. not an ASCII value but the meaning of an extended function code.  So if you
  56. were to enter:
  57.  
  58.                                  ESC [0;68;"Hi there"p
  59.  
  60. DOS would know to change the meaning of the function key (in this case F10) to
  61. the sting enclosed in quotes.  This is the key to redefining your function
  62. keys to perform much used commands: like DIR, CHKDSK, COPY *.* B: etc. or to
  63. load programs from disk.
  64.  
  65. There is a final trick here.  If you end the escape command sequence with the
  66. characters ";13p" instead of just "p" the command will self-execute, just as
  67. if you pressed the [enter] key.
  68.  
  69. The IBM documentation tells the user to preface each command by an ESC
  70. command, and I have represented this in the above paragraphs by writing the
  71. characters "ESC." at the start of each control code sequence mentioned.  Most
  72. users assume that this means to press the ESC key on the keyboard when
  73. entering the commands.  Not so.  To get the Escape Sequence to the ANSI driver
  74. you must enter it using a prompt command or write a .COM file.  For example to
  75. configure the F1 key (extended function code 59) to have the meaning in DOS of
  76. "autoexec" with an [enter] command at the end of it you cannot type:
  77.  
  78.                                 ESC [0;59;"autoexec";13p
  79.  
  80. as the ESC will not be recognized by DOS as an escape sequence.  What DOS will
  81. recognize as an escape sequence is the characters "$e" although this surely
  82. looks strange at first.  Users familiar with the PROMPT command will notice
  83. that the "$" character is what the PROMPT command uses as an escape sequence,
  84. and that is precisely how we will get the redefinition to be recognized by
  85. DOS.  If you enter the following command:
  86.  
  87.  
  88.                                 PROMPT $e[0;59;"autoexec";13p
  89.  
  90. you will see that it works perfectly.  You now have the secret to redefining
  91. the function keys in DOS.  Simply write and run a batch file with a list of
  92. PROMPT commands and you will have done it.  One precaution, ECHO must be ON,
  93. otherwise DOS will suppress the PROMPT command and the escape sequences will
  94. not get through.
  95.  
  96. As an example, let's create a batch file called KEYON.BAT that will set F1 as
  97. EDITOR [enter], F2 as PC-FILE [enter], F3 as PC-CALC [enter], F4 as PC-GRAPH
  98. [enter], F5 as PC-TALK [enter], F6 as PC-WRITE [enter], F7 as BASICA [enter],
  99. F8 as DIR without the [enter], F9 to run a batch file called MENUOFF.BAT
  100. [enter] and F10 to run a batch file called MENUON.BAT [enter].  It would be as
  101. follows:
  102.  
  103.                 echo on
  104.                 PROMPT $e[0;59;"EDITOR";13p
  105.                 PROMPT $e[0;60;"PC-FILE";13p
  106.                 PROMPT $e[0;61;"PC-CALC";13p
  107.                 PROMPT $e[0;62;"PC-GRAPH";13p
  108.                 PROMPT $e[0;63;"PC-TALK";13p
  109.                 PROMPT $e[0;64;"PC-WRITE";13p
  110.                 PROMPT $e[0;65;"BASICA";13p
  111.                 PROMPT $e[0;66;"DIR"p
  112.                 PROMPT $e[0;67;"MENUOFF";13p
  113.                 PROMPT $e[0;68;"MENUON";13p
  114.                 prompt
  115.                 cls
  116.  
  117. You would also want to create another file called KEYOFF.BAT which resets the
  118. function key definitions to DOS normal.  The format would be:
  119.  
  120.                 echo on
  121.                 PROMPT $e[0;59;0;59p
  122.                 PROMPT $e[0;60;0;60p
  123.                 PROMPT $e[0;61;0;61p
  124.                 PROMPT $e[0;62;0;62p
  125.                 PROMPT $e[0;63;0;63p
  126.                 PROMPT $e[0;64;0;64p
  127.                 PROMPT $e[0;65;0;65p
  128.                 PROMPT $e[0;66;0;66p
  129.                 PROMPT $e[0;67;0;67p
  130.                 PROMPT $e[0;68;0;68p
  131.                 prompt
  132.                 cls
  133.  
  134. I should mention that the purpose of the final blank PROMPT command in each of
  135. these batch files is to reset the DOS prompt to A> or whatever your default
  136. prompt is.  It serves no redefinition purpose, but does keep the screen
  137. looking clean.
  138. ============================================================================
  139.                     CURSOR POSITIONING / MOVEMENT
  140. ----------------------------------------------------------------------------
  141.      To move the cursor to a specified position: ESC [#;#h where the first #
  142.      is the desired line number and the second the desire column.
  143.  
  144.      To move the cursor up without changing columns: ESC [#a where # specifies
  145.      the number of lines moved.
  146.  
  147.      To move the cursor to a specified horizontal and vertical position: ESC
  148.      [#;#f where # means first the line number and secondly the column number.
  149.  
  150.      To get a cursor position report: ESC [#;#r where the first # specifies
  151.      the current line and the second # specifies the current column
  152.  
  153.      To move the cursor down: ESC [#b where # specifies the number of lines
  154.      moved down.
  155.  
  156.      To move the cursor forward: ESC [#C where # specifies the number of
  157.      columns moved.
  158.  
  159.      To move the cursor backward: ESC [#d where # specifies the number of
  160.      columns moved.
  161.  
  162.      To save the cursor position: ESC [s and to restore it: ESC [u.
  163. =========================================================================
  164.                   ERASING SCREEN (CLS) AND ERASING A LINE
  165. -------------------------------------------------------------------------
  166.      To do a CLS (erase screen move cursor to home position): ESC [2j
  167.  
  168.      To erase from cursor to end of line: ESC [k
  169. =============================================================================
  170.            DEVICE STATUS REPORT (Does NOT appear to work on AMIGA)
  171. -----------------------------------------------------------------------------
  172.      To get a device status report: ESC [6n
  173. =============================================================================
  174.                           ANSI COLOR GRAPHICS
  175. -----------------------------------------------------------------------------
  176.      To set the color/graphics attributes, enter ESC [#;#m where the first #
  177.      is the desired foreground color and the second is the desired background
  178.      color.  Select colors from the list below:
  179.  
  180. (NOTE: Following amiga colors were with preferences settings of blue, black,      
  181.       orange and white default colors.)
  182. ---------------------------------------------------------------------------
  183.    CODE  US ANSI STANDARDS RESULT         CODE  AMIGA ANSI RESULT
  184. =======================================================================
  185.      30  black foreground-----------------  30  Blue foreground (text)
  186.      31  red foreground-------------------  31  White foreground (text)
  187.      32  green foreground----------------   32  Black foreground (text)
  188.      33  yellow foreground---------------   33  Orange foreground (text)
  189.      34  blue foreground-----------------   34  Blue foreground (text)
  190.      35  magenta foreground--------------   35  White Forground (text)
  191.      36  cyan foreground-----------------   36  Black foreground (text)
  192.      37  white foreground----------------   37  Orange foreground (text)
  193.      38  Unknown-------------------------   38  Unknown
  194.      39  Unknown-------------------------   39  Unknown
  195. ----------------------------------------------------------------------------
  196.      40  black background----------------   40  Blue background
  197.      41  red background------------------   41  White Background
  198.      42  green background----------------   42  Black background
  199.      43  yellow background---------------   43  Orange background
  200.      44  blue background-----------------   44  Blue background
  201.      45  magenta background--------------   45  White background
  202.      46  cyan background-----------------   46  Black Background
  203.      47  white background----------------   47  Orange background
  204.      48  Unknown-------------------------   48  Unknown
  205.      49  Unknown-------------------------   49  Unknown
  206. NOTE: Please note that for both the foreground and background sections, the
  207. colors repeat after each four codes; ie: Blue text = 30 or 34;
  208. Blue background= 40 or 44..  Also, as long as you know the escape code for
  209. the foreground color, the same color for background will be 10 numbers higher.
  210. This is true for both the IBM and Amiga.
  211. =============================================================================               
  212.                    -- ADDITIONAL ANSI ATTRIBUTES --
  213. -----------------------------------------------------------------------------
  214.      To set additional attributes enter: ESC [#m where # is the number of the
  215.      desired attribute.  Select attributes from the list below:
  216.  
  217.      0  all attributes off (defaults to original Preferences settings)
  218.  
  219.      IBM ESCAPE CODE                          AMIGA RESULT
  220. ---------------------------------------------------------------
  221.      0  All ansi attributes off            0  All ansi attributes off
  222.      1  bold on                            1  BOLD ON
  223.      2  Unknown                            2  Turns text black
  224.      3  Italics on                         3  Italics on
  225.      4  underscore                         4  underscore
  226.      5  blink                              5  does NOT work on amiga
  227.      6  Unknown                            6  Unknown
  228.      7  reverse video                      7  Reverse video
  229.      8  invisible                          8  Invisible
  230. ---------------------------------------------------------------------------
  231.                IBM EXAMPLES FOR USE OF ANSI ATTRIBUTE CODES
  232. To give an example of what can be done with these additional codes, a batch
  233. file called MENUOFF.BAT containing only the line:
  234.  
  235.                         PROMPT $e[2J$e[30;40m$h
  236.  
  237. would blank a color display completely.  It does a CLS, sets the display to a
  238. black foreground and background and the with the "$h" performs a backspace to
  239. erase the blinking cursor (the "$h command is documented in the DOS manual
  240. under PROMPT).
  241.  Another batch file called MENUON.BAT containing the lines:
  242.  
  243.       PROMPT $e[0m
  244.       prompt
  245.       cls
  246.  
  247. Would reset a color display to restore the screen after MENUOFF.BAT had been
  248. run.
  249. =========================================================================
  250.      USING DEBUG TO LOAD THE ANSI DRIVER  (APPLICABLE ONLY TO IBM)
  251. -------------------------------------------------------------------------
  252. While there is no reason why we could not continue to configure our function
  253. keys by batch files consisting of lists of PROMPT commands, this is a clumsy
  254. way to proceed.  It is easier to use the DEBUG utility supplied with DOS to
  255. create a .COM file that will do the job for us quickly and directly, without
  256. sending any input to screen.
  257.  
  258. Place a formatted DOS disk containing the DEBUG utility in the default drive,
  259. and follow the script below.  As you do so hexadecimal numbers will appear on
  260. the left hand side of your screen.  These numbers will vary depending on the
  261. configuration of your system.  For our purposes here I will represent the
  262. numbers in the form xxxx:nnnn.  What you will see on your screen will be
  263. different.
  264.  
  265. A>DEBUG [enter]
  266. -A 100 [enter]
  267. MOV AH,9 [enter]
  268. MOV DX,109 [enter]
  269. INT 21 [enter]
  270. INT 20 [enter]
  271. xxxx:nnnn DB 1B'[0;59;"EDITOR";13p' [enter]
  272. xxxx:nnnn DB 1B'[0;60;"PC-FILE";13p' [enter]
  273. xxxx:nnnn DB 1B'[0;61;"PC-CALC";13p' [enter]
  274. xxxx:nnnn DB 1B'[0;62;"PC-GRAPH";13p' [enter]
  275. xxxx:nnnn DB 1B'[0;63;"PC-TALK";13p' [enter]
  276. xxxx:nnnn DB 1B'[0;64;"PC-WRITE";13p' [enter]
  277. xxxx:nnnn DB 1B'[0;65;"BASICA";13p' [enter]
  278. xxxx:nnnn DB 1B'[0;66;"DIR"p' [enter]
  279. xxxx:nnnn DB 1B'[0;67;"MENUOFF";13p' [enter]
  280. xxxx:nnnn DB 1B'[0;68;"MENUON";13p' [enter]
  281. xxxx:nnnn DB 1B '$' [enter]
  282.  
  283.      As soon as you have entered the previous line, your computer will respond
  284.      with a number in the form of xxxx:nnnn.  Copy down the portion of the
  285.      number that is being represented here as "nnnn" as you will need it
  286.      later.  Once you have copied the number down, press [enter]
  287.  
  288. xxxx:nnnn [enter]
  289. -N KEYON.COM [enter]
  290. -R BX [enter]
  291.  
  292.      When you have entered the command above, your computer will respond with
  293.      the following line and a colon as a prompt.  At this prompt enter 0 and
  294.      press [enter].
  295.  
  296. BX:0000
  297. :0 [enter]
  298. -R CX [enter]
  299.  
  300.      When you enter the R CX command above, the computer will respond with the
  301.      following line and a colon as a prompt.  At this prompt enter the number,
  302.      "nnnn" you copied down above and press [enter].
  303.  
  304. CX 0000
  305. :nnnn [enter]
  306. -W [enter]
  307.  
  308.      The computer will respond with the following.
  309.  
  310. WRITING nnnn bytes
  311. -Q [enter]
  312.  
  313. As soon as you enter the Q command (for Quit) you will be back at the DOS
  314. prompt, and there will be a new file on disk called KEYON.COM.  Simply type it
  315. at the DOS prompt and your function keys will be configured.  It is a good
  316. idea to use this same procedure to write another .COM file called KEYOFF.COM
  317. which will restore the keys to their native DOS definitions.  The procedure
  318. for this is the same as the above, except that the definition section should
  319. be:
  320.  
  321. xxxx:nnnn DB 1B'[0;59;0;59p' [enter]
  322. xxxx:nnnn DB 1B'[0;60;0;60p' [enter]
  323. xxxx:nnnn DB 1B'[0;61;0;61p' [enter]
  324. xxxx:nnnn DB 1B'[0;62;0;62p' [enter]
  325. xxxx:nnnn DB 1B'[0;63;0;63p' [enter]
  326. xxxx:nnnn DB 1B'[0;64;0;64p' [enter]
  327. xxxx:nnnn DB 1B'[0;65;0;65p' [enter]
  328. xxxx:nnnn DB 1B'[0;66;0;66p' [enter]
  329. xxxx:nnnn DB 1B'[0;67;0;67p' [enter]
  330. xxxx:nnnn DB 1B'[0;68;0;68p' [enter]
  331. xxxx:nnnn DB 1B '$' [enter]
  332.  
  333. If you find that KEYON.COM doesn't work correctly, reboot the machine to clear
  334. the definitions and try again.  The most common mistakes are typing errors (I
  335. often enter a colon when I wanted a semi-colon).  Another source of difficulty
  336. will arise if you have another file on disk to start with called KEYON.COM or
  337. KEYOFF.COM.  DEBUG bypasses the normal file allocation of DOS and writes
  338. directly to the disk.  If you have another file on disk with the same name,
  339. DEBUG will overwrite it, but unless the other file was exactly the same size
  340. as the new one or smaller, there may be a piece of the old file left over
  341. attached to the end of the new one.  As a precaution, always erase old
  342. versions of the .COM files, or better yet give each one a unique name and
  343. rename it later using the DOS Rename command.
  344. =============================================================================
  345.               USING ANSI ON AMIGA WITH BBS-PC! SOFTWARE
  346.  
  347. -----------------------------------------------------------------------------
  348.       This article is from the November, 1986 issue (#2) of AMIGAZINE!
  349.  
  350.  
  351.    THIS ARTICLE IS COPYRIGHT (C) 1986 DIGITAL PUBLISHING, AND BRIAN JEAN.
  352.    ALL RIGHTS RESERVED.  DISTRIBUTION RIGHTS GRANTED TO GENIE AND DELPHI.
  353.  
  354.  
  355.                 Creating Custom Color Menus For BBS-PC!
  356.                      (Using ANSI Escape Sequences)
  357.  
  358.                             By Brian Jean
  359.  
  360.  
  361. Running a BBS (Bulletin  Board  Service)  can  be  a lot of fun, and a lot of
  362. work.  SYSOPs  (SYStem  OPerators)  are  forever  trying  to  make  their BBS
  363. look different from the BBS  next  door,  even though they may be running the
  364. same software. ANSI escape sequences are one such way of making your BBS look
  365. different from all the others.
  366.  
  367. In the example I am about to give,  BBS-PC!  software is being used. Although
  368. the syntax may differ a bit, the  concept  should  work the same for those of
  369. you running a BBS on other than BBS-PC!.
  370.  
  371. BBS-PC!  allows  the  SYSOP  to  customize  his  menus.  It  is  through this
  372. customization process that we are allowed to insert our ANSI escape sequences
  373. to add color and cursor control to our menus. Before we can get into the meat
  374. of things, you must first  understand  how  BBS-PC!  allows you to add "ASCII
  375. CHARACTER GRAPHICS" to your menus.  Although  we  will not actually be adding
  376. ASCII CHARACTER GRAPHICS,  the  technique  we  will be using is the same. The
  377. syntax is simple.  Within your  menu,  place  a  backslash  (\) followed by a
  378. number, which is the ASCII value  for  the  character  you want inserted into
  379. your menu.  For example, let's say you  want  to actually add a backslash  to
  380. your menu. You can not simply type in a backslash because BBS-PC! will see it
  381. and view it as a special character  telling  the  menu compiler that an ASCII
  382. value will follow.  Therefore, the syntax would be:
  383.  
  384.                                    \92
  385.                                    | |
  386.    Tells the menu compiler an -----+ +----- The ASCII value
  387.    ASCII value will follow                  for a backslash (\)
  388.  
  389. That's it. Real simple. So, if you wanted part of your menu to look like
  390. this:
  391.  
  392.                     +---------------------------------+
  393.                     | R:Read Messages    D:Down Loads |
  394.                     |                                 |
  395.                     | \:Page SYSOP       G:Good-bye   |
  396.                     |                                 |
  397.  
  398. The actual syntax in your menu (prior to compiling) would be:
  399.  
  400.                     +---------------------------------+
  401.                     | R:Read Messages    D:Down Loads |
  402.                     |                                 |
  403.                     | \92:Page SYSOP       G:Good-bye |
  404.                     |                                 |
  405.  
  406. Now that you have the general idea, let's get to work on a real menu.
  407.  
  408. Adding the color and cursor  control  is  easy.  We'll be using the backslash
  409. followed by an ANSI escape sequence. The two sequences we will be using are:
  410.  
  411.                          ESC[xM and ESC[r,cH
  412.  
  413.                         Where ESC = ESCape (ASCII 27)
  414.                                 [ = "["
  415.                                 x = Color Code
  416.                                 M = "M"
  417.                                 r = Row #
  418.                                 c = Column #
  419.                                 H = "H"
  420.  
  421. The first sequence adds color and the second places the cursor at a specified
  422. ROW and COLUMN.
  423.  
  424. The following is a modified version of the  actual Main Menu as I have it set
  425. up on  my  BBS.  Because  of  the  screen  width  limitation  here  for  this
  426. demonstartion, some of the menu  has been extracted to make room for the most
  427. important part.  The very first  part of  each line, which reads TITLE =, has
  428. been eliminated, along with some of the  filler characters such as several of
  429. the "-" characters in the  border.   See  your  BBS-PC! manual for the proper
  430. syntax of menus as required by your menu compiler.
  431.  
  432. menu = BBS-0.MEN, "\13\13\13Main Func (? for menu): ", 1, 2
  433. \12 \13 \13 \27[33m+-------------------------------------------MAIN MENU-+"
  434. |                    Message Commands                     |"
  435. |                    ----------------                     |"
  436. |    Scan Message        E-Mail          Read Messages    |"
  437. |    Leave Message       Price List      Comment to SYSOPm|"
  438. |                                                         |"
  439. |                    System Commands                      |"
  440. |                    ---------------                      |"
  441. |    Good-bye            Caller log      Time on System   |"
  442. |    Section mask        Expert          Change Options   |"
  443. |    Your Stats.         40 Column       Page SYSOP       |"
  444. |    Bulletins/Help      Display         File U/Dload     |"
  445. | \27[0m              !: Turn Off ANSI                    |"
  446. +---------------------------------------------------------+ \27[0m"
  447. title = "\27[0m \27[6;12H S: \27[6;32H E: \27[6;48H R:"
  448. title = "\27[7;12H L: \27[7;32H P: \27[7;48H C:"
  449. title = "\27[11;12H G: \27[11;32H U: \27[11;48H T:"
  450. title = "\27[12;12H M: \27[12;32H X: \27[12;48H O:"
  451. title = "\27[3;30H \7 THE AMIGA PROJECT! "
  452. title = "\27[13;12H Y: \27[13;32H +: \27[13;48H /:"
  453. title = "\27[14;12H B: \27[14;48H F:"
  454.  
  455.  
  456. This is how the menu looks to the user when he or she calls in:
  457.  
  458.  
  459. +------------------ THE AMIGA PROJECT! ---------MAIN MENU-+
  460. |                    Message Commands                     |
  461. |                    ----------------                     |
  462. | S: Scan Message     E: E-Mail       R: Read Messages    |
  463. | L: Leave Message    P: Price List   C: Comment to SYSOP |
  464. |                                                         |
  465. |                    System Commands                      |
  466. |                    ---------------                      |
  467. | G: Good-bye         U: Caller log   T: Time on System   |
  468. | S: Section mask     X: Expert       O: Change Options   |
  469. | Y: Your Stats.      +: 40 Column    /: Page SYSOP       |
  470. | B: Bulletins/Help      Display      F: File U/Dload     |
  471. |                     !: Turn Off ANSI                    |
  472. +---------------------------------------------------------+
  473.  
  474.  
  475. Main Func (? for menu):
  476.  
  477.  
  478. Now for a line by line description of what we just did. 
  479.  
  480. menu = BBS-0.MEN, "\13\13\13Main Func (? for menu): ", 1, 2
  481.  
  482. The very first line defines the  name  of  the  menu and the prompt used. The
  483. only thing new here from the standard  menu  is the three "\13"'s. This sends
  484. three ASCII 13's (RETURN's) to the  user.  This is VERY important in the menu
  485. as I have it set up. Without it, your  menu  prompt  will pop up somewhere in
  486. the middle of the screen.
  487.  
  488. \12 \13 \13 \27[33m+-------------------------------------------MAIN MENU-+"
  489.  
  490. The next line is where the fun begins. the  "\12" sends an ASCII 12, which is
  491. more commonly know as a screen clear.  This  will clear your user's screen to
  492. ensure proper menu positioning.  If  the  system  your user is using does not
  493. recognize ASCII 12 as a screen clear, then this menu will look like a mess to
  494. him. I'll explain later what to do if this  happens. After the \12, comes two\13's. This again, sends two more RETURN's  to the user. This just places the
  495. menu two lines down from the top  of  the  menu.  \27[33m  is the first color
  496. sequence. This turns the character  color  to  RED. Everything following will
  497. show up on the callers screen as color. I said 33 is RED, but RED is not what
  498. is always seen. The actual color seen will depend on what the user has his or
  499. her colors set to in preferences. The SYSOP will see YELLOW in his menu. This
  500. is due to the color definitions  used  in  BBS-PC!.  I haven't found a way to
  501. change this.
  502.  
  503. The remainder of the menu is then sent in RED, until it comes to this line.
  504.  
  505. | \27[0m              !: Turn Off ANSI                    |"
  506.  
  507. The \27[0m turns off ALL ANSI escape sequences which are now active. In other
  508. words, the character  color  received  by the caller will return to white, or
  509. what ever color that user has  set  his  or  her white to in preferences. The
  510. reason I did this in this line,  is  because  my  default  menu uses the ANSI
  511. sequences. A user who is  calling  with  a  terminal that can not accept ANSI
  512. sequences will see a mess for a menu  the  first  time through. The comand to
  513. turn off the ANSI is then clearly visible.
  514.  
  515. As I am sure you have noticed, what  we  have  actually done here, is display
  516. the menu descriptions, but not the actual  commands.  A user sees a menu that
  517. says SCAN MESSAGES E-MAIL PAGE SYSOP etc  ..., but the user doesn't know what
  518. key to press to activate that command. Here's  where the real fun begins. The
  519. following sequences cause the cursor to jump around the screen filling in the
  520. actual commands. This can make for a real interesting menu.
  521.  
  522. Here's the sequences that actually do that.
  523.  
  524. title = "\27[0m \27[6;3H S: \27[6;23H E: \27[6;39H R:"
  525.  
  526. The first sequence (\27[0m) turns off all ANSI as it did before, this causes 
  527. the actual commands to pop onto the screen in a color different from the rest
  528. of the menu. The next sequence  \27[6;3H S: sends the cursor to row 6, column
  529. 3 and prints S: the command for Scan Messages. \27[6;23H E:  sends the cursor
  530. to row 6, column 23 and prints E:, then command for E-Mail.
  531.  
  532. As you can now see, we are filling in the  menu. You should have little or no
  533. trouble figuring out what the remainder  of the sequences do.  They all go to
  534. a specified row and column and print a command.
  535.  
  536. title = "\27[3;21H \7 THE AMIGA PROJECT! "
  537.  
  538. This one sends the cursor to row  3, column  21  and sends an ASCII 7, better
  539. known as CONTROL-G or a  bell,  followed  by  the  name  of my BBS, THE AMIGA
  540. PROJECT!
  541.  
  542. That's it. That's all there is to it. 
  543.  
  544. The way I have my BBS set up, when  a  user  selects  the ! command (Turn OFF
  545. ANSI), it sends the user to another menu  set which does not utilize the ANSI
  546. escape sequences. I also have two  menus  set up for the AMIGA in my terminal
  547. definitions. One is called  AMIGA!  and  the  other  is called AMIGA! *ANSI*.
  548. Obviously, one uses the ANSI escape  sequences  and  the other does not. This
  549. allows each user to decide for himself if  he does or does not want the fancy
  550. color and screen display.
  551.  
  552. There are a lot more ANSI sequences available. Get you hands on an ANSI table
  553. and see what variations you can come  up  with  for menu display. A few quick
  554. examples of more ANSI sequences are:
  555.  
  556.           ESC[nC   where n = a number. The cursor is then moved right that
  557.                    number of lines without changing rows.
  558.  
  559.           ESC[nD   where n = a number. The cursor is then moved left that
  560.                    number of lines without changing rows.
  561.  
  562.           ESC[K    where K = the letter "K". Erases the curent line from the
  563.                    cursor position to the end.
  564.  
  565. Most of the popular public domain  terminal  programs  accept the ANSI escape
  566. sequences.  Some, such as OnLine!,  allow  the user to choose between several
  567. terminal types, one of which is ANSI.  The  user  MUST  be set to ANSI or the
  568. screen will be a mess on his end.
  569. If you want to take a quick look  at  what  this  demonstration  really looks
  570. like, feel free to set your terminal to ANSI, and give my BBS a call. You can
  571. reach us at 300/1200 baud, 24 hrs, (805) 834-9383.
  572. =============================================================================
  573.                 RBBS-PC SYSOP ANSI.SYS COLOR HELP
  574.        Adding Ansi Color and MUSIC to your WELCOMEG File
  575.         NOTE: MUSIC codes do not appear to work on AMIGA
  576. ------------------------------------------------------------------------------
  577.    In order for a Caller to receive color and music from an RBBS, the
  578. Caller needs to have the statement:  DEVICE=ANSI.SYS in the CONFIG.SYS
  579. file (and reboot system), or PC-TALK with ANSI.MRG applied (merged),
  580. plus DOS 2.x operating system.
  581.    The SYSOP needs to run RBBS-PC version CPC12.2A (or later), and have
  582. the appropriate Escape codes in the WELCOMEG file.  Please read chapter
  583. 13 of the DOS 2.0 Manual for a very brief summary of escape codes.
  584.  
  585.    The Escape codes will allow you to issue special character sequences
  586. to the Caller which will permit screen formatting, color graphics and
  587. music to be executed for the Caller.
  588.  
  589.    The Escape Code is ASCII 027 and Hex 1B and cannot be issued within
  590. EDLIN or DOS.  The normal procedure is to use a dummy variable to represent
  591. the Esc code and then go into DEBUG and replace the dummy variable with
  592. Hex 1B.  However, Volkswriter, Volkswriter Delux and PC-WRITE (freeware)
  593. issue a true ESC code when the ESC key is depressed.  If you have access
  594. to one of these word processing programs, you can set up your graphics
  595. first, then go into the word processing program and insert the ESC codes
  596. to enable color graphics and music.  However, appended to this help file
  597. is a program known as SGR.TXT (or CLR.TXT) which contains true ESC codes
  598. which can be copied over to your WELCOMEG file using the Transfer function
  599. of EDLIN (if last line in your file is 99, then issue:  100TANSICLR.HLP
  600. and you will append this file to the end of your WELCOMEG file.  Then
  601. copy and delete as appropriate to move the ESC codes to where they are
  602. needed.
  603.  
  604. BEGINNING OF YOUR FILE:
  605.  
  606.    All ANSI color/music/format statements have the format:
  607.  
  608.       nn;nn;x  where nn is a valid number and x is an alpha operand.
  609.  
  610.         set attributes off (0) bold on (1) white f/g (37)
  611.                      and blue background (44)
  612.    At the beginning of your file you will want a format command to 
  613. start the text in the middle of the screen so the Caller will have
  614. time to read it as it scrolls upward.
  615.    1;f  The first 0 turns off any attributes the caller has set
  616.                   on his/her own system before calling your RBBS.  The
  617.                   second statement starts text at line 17 column 1 and the
  618.                   "f" operand is for format.
  619.   Your second line should specify the color, with bold (highlight) on or
  620. off and blinking (05) on or off:
  621. ;37;44;M   "1" turns bold on; "37" white foreground; "44" blue
  622.                  background; "m" designates Set Graphics Rendition mode
  623.    Now, if you do nothing else, the callers screen will start on the
  624. 17th line in the first column, and will stay bold white letters on a
  625. blue background.  The text/graphics will scroll normally from the 17th
  626. line and the color will not change until the caller signs off.
  627.       j   inserted at the end of the first 23 lines of graphics
  628.                 on line 24, will return to white on black and erase the
  629.                 screen and place the curser on the home position.
  630.         inserted on line 25 will turn green foreground and black
  631.                 (default) background on, until the next ESC code is read.
  632.                  bold is now off and blinking is off (due to the 0; cmd)
  633.         turns bold on and green f/g with (default) black b/g.
  634.    You can insert ESC codes inside graphic frames to change the color
  635. of the lettering inside the frame, leaving the frame a different color:
  636.   Do not forget to add ^[00m as the last attribut so as to return the
  637.   callers screen to his own default settings.
  638.  
  639.    Please notice that the ESC codes are INSERTED and place the vertical
  640. bars out of alignment, even though they will display correctly (try
  641. TYPE ANSICLR.HLP to see display if you have ANSI.SYS in your CONFIG.SYS).
  642. For this reason, we recommend constructing your graphics first, and then
  643. insert the ESC codes using PC-WRITE or Volkswriter, or some other personal
  644. editor like EDLIN.
  645.  
  646. FORMATTING
  647.  
  648.    The ESC[[xx;yy;F command will format the screen where xx is column number
  649. and yy is line number.  You can either start the screen at column x and
  650. line y and then let it scroll normally, or you can continue to format the
  651. screen, by subsequent ESC[[xx;yy;F commands telling the cursor where to
  652. start printing the line of text which follows the format statement.  
  653. After the last format statement, the text will continue to scroll normally.
  654. Just remember if you continue formatting you will have less control over
  655. where the page breaks will fall, but trial and error will get you through.
  656.  
  657. MUSIC
  658.  
  659.    Music works just like the BASIC PLAY statement, except the Music
  660. Background statement will not work in RBBS-PC.  The format is:
  661.  
  662. MFO..............................................
  663.  
  664.    will play music in foreground (MFO is letter O not zero).  The MFO
  665. statement is required only for the first line of each song, and each
  666. line of the song can terminate with the ESC N.  The letter O in MFO
  667. sets the current octave (from 0 to 6) for the following notes.  Instead
  668. of MFO you can use MSO for staccato or MST150 for Staccato Tempo 150
  669. (tempo default is 120 quarter notes in a minute).  You may want to
  670. create your music using BLUESBOX.BAS and then append the resulting
  671. music and copy it to the correct line number and insert the ESC codes
  672. required.
  673.  
  674. CLOSING YOUR FILE
  675.  
  676. You should close your file with an ESC[[0 to turn off the colors,
  677. highlighting and flashing or it will continue on the Callers screen
  678. throughout the session.  
  679.    If you wish to leave color on, remember Callers will be using monochrome
  680. screens and some colors are almost unreadable on monochrome, which
  681. defeats the purpose of having a Bulletin Board System.  We recommend
  682. leaving green on black, yellow on black or white on blue: (For IBM systems)
  683.   Bold on; yellow f/g; black b/g
  684.   Bold on; green f/g; black b/g
  685.   Bold on; white f/g; blue b/g
  686.